Nested relational query languages have been explored extensively, andunderlie industrial language-integrated query systems such as Microsoft's LINQ.However, relational databases do not natively support nested collections inquery results. This can lead to major performance problems: if programmerswrite queries that yield nested results, then such systems typically eitherfail or generate a large number of queries. We present a new approach to queryshredding, which converts a query returning nested data to a fixed number ofSQL queries. Our approach, in contrast to prior work, handles multisetsemantics, and generates an idiomatic SQL:1999 query directly from a normalform for nested queries. We provide a detailed description of our translationand present experiments showing that it offers comparable or better performancethan a recent alternative approach on a range of examples.
展开▼